<div class="rightBorder" id="rightinfo_content">
<div id="more_dynameic" style="display: none;">
	<!--{template template_more_dynameic}-->
</div>	
<div class="briefMenu modal-header dtheme border-bottom clearfix">
	<div class="modal-title">
		<!--{if $fileinfo['isgroup'] && $fileinfo['gid']}-->
		<a href="javascript:;" class="right-topbackground">
			{eval echo avatar_group($gid);}
		</a>
		<!--{elseif $fileinfo['flag'] == 'home'}-->
		<i class="mdi mdi-account-box text-primary right-topicon"></i>
		<!--{elseif $fileinfo['ismulti']}-->
		<i class="mdi mdi-file-multiple text-primary right-topicon"></i>
		<!--{elseif $bz && $fileinfo['bz']}-->
		<img src="dzz/images/default/system/{$fileinfo['bz']}.png">
		<!--{else}-->
		<img src="dzz/images/default/system/folder.png">
		<!--{/if}-->
		<span class="text-truncate fs-6 ps-1"><!--{if $fileinfo['ismulti']}-->{lang more_select}<!--{else}--><!--{if $fileinfo[name]}-->$fileinfo[name]<!--{elseif $fileinfo[fname]}-->$fileinfo[fname]<!--{else}--><!--{/if}--><!--{/if}--></span>
		<button type="button" class="toggRight btn-close"></button>
	</div>
</div>
<div class="right-messagetable scroll-y" <!--{if $commentperm}-->data-subtractor="{eval echo ($fid || $rid)?54:0}"<!--{/if}-->>
	<!--{if !$bz}-->
	<!--根文件进度条开始-->
	<!--{if ($fileinfo['isgroup'] || $fileinfo['pfid'] == 0) && !$fileinfo['ismulti']}-->
    <div class="right-progress m-2">
		<p class="mb-0">已使用{eval echo formatsize($usesize);}(<!--{if $maxspace == 0}-->不限制<!--{elseif $maxspace < 0}-->0<!--{else}-->共{eval echo formatsize($maxspace);}<!--{/if}-->)</p>
	    <div class="progress">
		  <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:{$progress}%;">
		  </div>
		</div>
	</div>
	<!--{/if}-->
	<!--{/if}-->
	<!--根文件进度条结束-->
    <!--文件夹详情开始-->
    <div class="p-2 border-bottom" id="folderinfo">
		<div class="row mb-1">
			<label class="col-sm-4">{lang type}</label>
			<div class="col-sm-8">$fileinfo['type']</div>
		</div>
		<!--{if $fileinfo[realpath]}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang position}</label>
			<div class="col-sm-8 text-break">$fileinfo[realpath]</div>
		</div>
		<!--{/if}-->
		<!--{if $fileinfo['username']}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang possesor}</label>
			<div class="col-sm-8 text-break">$fileinfo['username']</div>
		</div>
		<!--{/if}-->
		<!--{if $fileinfo[contain]}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang include}</label>
			<div class="col-sm-8 text-break">$fileinfo[contain]</div>
		</div>
		<!--{/if}-->
		<!--{if $fileinfo[ffsize]}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang big_small}</label>
			<div class="col-sm-8 text-break">$fileinfo[ffsize]</div>
		</div>
		<!--{/if}-->
		<!--{if $fileinfo[fdateline]}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang create_time}</label>
			<div class="col-sm-8 text-break">$fileinfo[fdateline]</div>
		</div>
		<!--{/if}-->
		<!--{if $fileinfo[editdateline]}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang preceding_edit_time}</label>
			<div class="col-sm-8 text-break">$fileinfo[editdateline]</div>
		</div>
		<!--{/if}-->
		<!--{if $fileinfo[opendateline]}-->
		<div class="row mb-1">
			<label class="col-sm-4">{lang preceding_open_time}</label>
			<div class="col-sm-8 text-break">$fileinfo[opendateline]</div>
		</div>
		<!--{/if}-->
    </div>
	<!--{if $perm && $fileinfo['isdelete'] < 1}-->
	<div class="p-2 border-bottom">
		<div class="right-card-header">
			<div class="title">{lang directory_right}</div>
			<!--{if isset($usergroupperm) && $usergroupperm > 0}--><button type="button" class="dcolor conpile-poewr" onclick="editgroupperm('{$fileinfo[gid]}','{$fileinfo[fid]}')"><span class="mdi mdi-pencil fs-6"></span></button><!--{/if}-->
		</div>
		<div class="right-card-body">
			<ul class="proper-show proper-poewr">
				<!--{loop $perms $k $val}-->
				<li <!--{if $perm & $val[1]}-->style="display:block;"<!--{else}-->style="display:none;"<!--{/if}-->><span class="{$val[2]}" title="$val[0]"></span></li>
				<!--{/loop}-->
			</ul>
		</div>
		
	</div>
	<!--{/if}-->
    <!--成员开始-->
	<!--{if $fileinfo['isgroup']}-->
    <div class="p-2 border-bottom">
		<div class="right-card-header">
			<div class="title">{lang member}<i class="ms-1 mdi mdi-information-outline" data-toggle="tooltip" data-placement="right" title="机构部门的成员权限需要前往机构用户中设置"></i></div>
			<!--{if $usergroupperm >= 1 && $org['type']}-->
			<button type="button" class="groupbutton dcolor" onclick="select_group_user();return false;"><span class="mdi mdi-plus-circle"></span></button>
			<!--{/if}-->
		</div>
		<div class="right-card-body">
			<ul class="right-numerbottom clearfix" id="memberlist" data-gid="{$gid}">
				<!--{loop $members $v}-->
				<li class="right-numer-carousel" id="{$v['uid']}_delete" >
					<a href="javascript:;" class="js-popbox member_details_info" data-placement="bottom" data-trigger="focus" data-auto-adapt="true" data-toggle="popover" style="display: inline-block;width: 28px;" data-href="{MOD_URL}&op=group&do=right_popbox&gid=$gid&uid={$v['uid']}">
					{eval echo avatar_block($v['uid'],array($v['uid']=>$v['headerColor']));}
					<!--{if $v['perm'] > 1  && $org['type'] == 1 }-->
					<span class="right-first creator"><img src="{MOD_PATH}/images/ic-creator.png"></span>
					<!--{elseif $v['perm'] > 0}-->
					<span class="right-first"><img src="{MOD_PATH}/images/ic-manager.png"></span>
					<!--{/if}-->
					</a>					
				</li>
				<!--{/loop}-->
			</ul>
		</div>
		
    </div>
	<!--{/if}-->
    <!--成员结束-->
    <!--关于开始-->
	<!--{if $org}-->
	<div class="p-2 border-bottom">
		<div class="right-card-header">
			<div class="title">{lang about}<i class="ms-1 mdi mdi-information-outline" data-toggle="tooltip" data-placement="right" title="机构部门的信息需要前往机构用户中设置"></i></div>
			<!--{if $usergroupperm >= 1 && $org['type']}-->
			<button type="button" class="groupbutton dcolor" onclick="showWindow('groupsetting','{MOD_URL}&op=group&do=group_ajax&operation=groupsetting&gid=$gid')">
				<span class="mdi mdi-pencil"></span>
			</button>
			<!--{/if}-->
		</div>
		<div class="right-card-body">
			<div class="row mb-1">
				<label class="col-sm-3">logo</label>
				<div class="col-sm-9">
					{eval echo avatar_group($gid);}
				</div>
			</div>
			<div class="row mb-1">
				<label class="col-sm-3">{lang name}</label>
				<div class="col-sm-9">
					$org[orgname]
				</div>
			</div>
			<div class="row mb-1">
				<label class="col-sm-3">{lang introduce}</label>
				<div class="col-sm-9">
					$org[desc]
				</div>
			</div>
			<div class="d-flex">
				<label class="col-sm-3">{lang status}</label>
				<div class="col-sm-9">
					<div class="form-check form-switch">
						<input type="checkbox" class="form-check-input" disabled="" readonly name="syatemon" data-name="manageon" <!--{if $org[diron] && $org[diron]}--> checked <!--{/if}-->>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--{/if}-->
    <!--关于结束-->
    <!--文件夹详情结束-->
    <!--文件夹动态开始-->
   <div class="m-2" id="filerightdynamic">
    <!--{template fileright_dynamic}-->
   </div>
    <!--文件夹动态结束-->
</div>
<!--{if $commentperm}-->
<!--{if !$fileinfo['ismulti']}-->
<!--{if $fid || $rid || !$bz}-->	
<div class="comment-area dtheme">
    <div class="messageMenu"> 
	    <form action="{MOD_URL}&op=ajax&operation=comment" method="post" onsubmit="return comment_file(this)" id="commentid">
	        <input type="hidden" name="rid" value="$rid" />
	        <input type="hidden" name="fid" value="$fid" />
	    	<div class="discuss-content">
	            <textarea type="text" id="leave_message" name="msg" rows="1" placeholder="{lang input_comments}" class="form-control"></textarea>
	            <div class="comment-file">
	                <ul class="list_acpsw">
	                    <li class="emotion_lacpsw"><a href="javascript:;" class="item_lacpsw" id="leave_messagesml" onclick="showMenu({'ctrlid':this.id,'evt':'click','layer':2});return false;"><span class="mdi mdi-emoticon-excited-outline"></span></a>
	                    </li>
	                </ul>
	            </div>
	             
	        </div>
	        <div class="activity-handler clearfix">
	             <button type="submit" class="mdi mdi-send pull-right disabled input-search-drop" style="color:rgba(55,121,255,0.3);"></button>
	        </div>
	    </form>
    </div>
</div>
<!--{/if}-->
<!--{/if}-->
<!--{/if}-->
</div>
<script>
var userids = '';
$(function () {
	$('[data-toggle="tooltip"]').tooltip()
})
$(document).ready(function(){
    userids = '{$userstr}';
});
jQuery(".right-numerbottom .js-popbox").each(function(){
		jQuery(this).popbox();
});
jQuery(document).on('click','.mdi-right-backing',function(){
	jQuery('#more_dynameic').hide();
})
function editgroupperm(gid,fid){
	showWindow('select_perm', MOD_URL+'&op=ajax&operation=selectperm&fid='+fid+'&gid='+gid+'&new=0','get','0');
}
function select_group_user(){
	var userhref = 'index.php?mod=system&op=selorguser&template=1&callback=seluser_group&stype=2&range=1&onlymyorg=<!--{if $_G['setting']['explorer_mermoryonlymyorg'] == '1'}-->0<!--{else}-->1<!--{/if}-->&multiple=1&ids='+userids;
    showWindow('adduser',userhref,'get','0')
}
function seluser_group(ids,data) {
    var formdata={};
    formdata.type=1;
    formdata.formhash='{FORMHASH}';
    formdata.selectsubmit=true;
    formdata.uids=ids.join(',');
    var gid = '{$gid}';
    var url = MOD_URL + '&op=group&do=group_ajax&operation=addgroupuser&gid='+gid;
    $.post(url, formdata, function (data) {
        if (data['success']) {
            var userarr = userids.split(',');
            if ($('#memberlist').length > 0 && $('#memberlist').data('gid') == gid) {
                var html = '';
                var usericon = '';
                //修改权限菜单
                for (var o in data['insertuser']) {
                    if (data['insertuser'][o]['avatarstatus'] == 1) {
                      	html+= '<li class="right-numer-carousel" id="' + data['insertuser'][o]['uid'] + '_delete" >';
                        html+= '<a href="javascript:;" class="js-popbox member_details_info adduser" data-placement="bottom" data-trigger="focus" data-auto-adapt="true" data-toggle="popover"  data-href="{MOD_URL}&op=group&do=right_popbox&gid=$gid&uid='+data['insertuser'][o]['uid']+'" style="display: inline-block;width:28px;">'; 
						 html+= '<img src="avatar.php?uid=' + data['insertuser'][o]['uid'] + '" class="img-circle img-avatar" style="width: 28px;">';
                        html+= '</a>';
                        html+= '</li>';
                    } else {
                        html+= '<li class="right-numer-carousel" id="' + data['insertuser'][o]['uid'] + '_delete">';
                        html+= '<a href="javascript:;" class="js-popbox member_details_info adduser" data-placement="bottom" data-trigger="focus"' +
                            'data-auto-adapt="true" data-toggle="popover" style="display: inline-block;width: 28px;"' +
                            'data-href="{MOD_URL}&op=group&do=right_popbox&gid=$gid&uid=' + data['insertuser'][o]['uid'] + '">';
                        html+= '<span class="Topcarousel img-avatar" style="background:' + data['insertuser'][o]['headerColor'] + '">' + data['insertuser'][o]['ufirst'] + '</span>';
                        html+='</a>';
                        html+='</li>';
                    }
                    if($.inArray(data['insertuser'][o]['uid'],userarr) == -1){
                        userarr.push(data['insertuser'][o]['uid']);
					}

                }
                for (var o in data['delusers']) {
                    $('#' + o+ '_delete').remove();
                    var index = $.inArray(o,userarr)
                    if(index != -1){
                        userarr.splice(index,1);
                    }
                }
                userids = userarr.join(',');
                $('#memberlist').append(html);
                $(".adduser").each(function(){
                    $(this).popbox();
                });
                hideWindow('adduser');//群组内添加成员
            } else {
                hideWindow('adduser');
                showWindow('select_perm', _explorer.appUrl + '&op=ajax&operation=selectperm&fid=$groupinfo[fid]&gid=$gid&new=true', 'get', 0);
            }
        } else if (data['error']) {
			layer.alert(data['error'], {skin:'lyear-skin-danger'});
        }
    }, 'json').fail(function (jqXHR, textStatus, errorThrown) {
            showmessage('操作失败，请稍后再试: ' + textStatus, 'error', 3000, 1);
        });
    return false;
    };
</script>